using UnityEngine;
using System.Collections;

public class Objective
{
    public string Id;
    public string AddionalInfo = "";
    public bool Completed = false;
    public int TotalAmount;
    public int CurrentAmount = 0;
    public string Text;


    public Objective()
    {

    }
    public void SendInfo(string id, int value, string info)
    {
        //Debug.Log("objective updated");
        if ((id == Id) && (info == AddionalInfo))
        {
            CurrentAmount += value;
        }
    }

    public virtual void Check()
    {

        if (CurrentAmount >= TotalAmount)
        {
            Debug.Log("objective completed");
            Completed = true;
        }
    }
    public bool IsCompleted()
    {
        return (CurrentAmount >= TotalAmount);
    }


}